import request from '@/utils/request'

// 分页查询委托协议单列表
export function entrustReceiptList(params) {
  return request({
    url: '/task/entrustReceipt/list',
    method: 'get',
    params: params,
  })
}

// 查询委托协议单详情
export function entrustReceiptDetail(entrustReceiptId) {
  return request({
    // url: `/task/entrustReceipt/${entrustReceiptId}`,
    url: `/task/detectionEquipment/getEntrustReceiptInfo/${entrustReceiptId}`,
    method: 'get',
  })
}

// 新增委托协议单
export function entrustReceiptAdd(data) {
  return request({
    url: `/task/entrustReceipt/add`,
    method: 'post',
    data: data
  })
}

// 修改委托协议单
export function entrustReceiptEdit(data) {
  return request({
    url: `/task/entrustReceipt/edit`,
    method: 'post',
    data: data
  })
}

// 删除委托协议单
export function entrustReceiptDelete(entrustReceiptIds) {
  return request({
    url: `/task/entrustReceipt/remove/${entrustReceiptIds}`,
    method: 'delete',
  })
}

// 生成委托协议书
export function entrustReceiptGenerator(entrustReceiptId) {
  return request({
    url: `/task/entrustReceipt/generator/${entrustReceiptId}`,
    method: 'post',
  })
}

// 生成评审任务
export function entrustReceiptCreateContract(entrustReceiptId) {
  return request({
    url: `/task/entrustReceipt/createContract/${entrustReceiptId}`,
    method: 'post',
  })
}